package cn.vcjf.weapp.api.goods.mapper;

import cn.vcjf.weapp.api.goods.entity.GoodsDiscount;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zhengzihang
 * @since 2018-09-25
 */
public interface GoodsDiscountMapper extends BaseMapper<GoodsDiscount> {

	/**
	 * 修改优惠券的数量(领取的优惠券后)
	 *
	 * @param goodsDiscount
	 * @param userId
	 * @return
	 */
	Integer updateGoodsDiscount(@Param("goodsDiscount") GoodsDiscount goodsDiscount,@Param("userId") Integer userId);

	/**
	 * 添加用户领取的优惠券
	 *
	 * @param goodsDiscount
	 * @param userId
	 * @return
	 */
	Integer addUserDiscount(@Param("goodsDiscount") GoodsDiscount goodsDiscount,@Param("userId") Integer userId);

	Integer findUserDiscount(@Param("goodsDiscount") GoodsDiscount goodsDiscount,@Param("userId") Integer userId);
}
